﻿using System.Linq;
using System.Windows.Input;

namespace Creventive.Wpf.ShellFactory.Workspace
{
    /// <summary>
    /// Represents a command with a typed parameter.
    /// </summary>
    /// <typeparam name="Tparam">The parameter type.</typeparam>
    public interface ICommand<in Tparam> : ICommand
    {
        /// <summary>
        ///   Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name = "parameter">Data used by the command.</param>
        void Execute(Tparam parameter);

        /// <summary>
        ///   Defines the method that determines whether the command can execute in its current state.
        /// </summary>
        /// <returns>
        ///   true if this command can be executed; otherwise, false.
        /// </returns>
        /// <param name = "parameter">Data used by the command.</param>
        bool CanExecute(Tparam parameter);
    }
}